home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk8
/
superlib
/
libsrc
/
openlibs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-18
|
1KB
|
63 lines
#include "xmisc.h"
long GfxBase;
long IntuitionBase;
long ExpansionBase;
long DiskfontBase;
long TranslatorBase;
long IconBase;
long MathBase;
long MathTransBase;
long MathIeeeDoubBasBase;
long MathIeeeSingBasBase;
long LayersBase;
long ClistBase;
long PotgoBase;
long TimerBase;
long xfiller15;
long xfiller16;
struct OLI strvar[] = {
"graphics", &GfxBase,
"intuition", &IntuitionBase,
"expansion", &ExpansionBase,
"diskfont", &DiskfontBase,
"translator", &TranslatorBase,
"icon", &IconBase,
"mathffp", &MathBase,
"mathtrans", &MathTransBase,
"mathieeedoubbas", &MathIeeeDoubBasBase,
"mathieeesingbas", &MathIeeeSingBasBase,
"layers", &LayersBase,
"clist", &ClistBase,
"potgo", &PotgoBase,
"timer", &TimerBase,
"x15", &xfiller15,
"x16", &xfiller16,
0L, 0L /* end marker for future compatibility */
};
openlibs(mask)
unsigned short mask;
{
register struct OLI *sv;
char buf[64];
long copymask = mask;
for (sv = &strvar[0]; mask && sv->name; mask >>= 1, ++sv) {
if (mask & 1) {
strcpy(buf, sv->name);
strcat(buf, ".library");
if (*sv->var == 0 && (*sv->var = OpenLibrary(buf, 0)) == 0)
goto fail;
}
}
return (1);
fail:
closelibs(copymask);
return (0);
}